package com.heimali.happyreader.ui.fragment.helper;

import com.heimali.happyreader.R;
import com.heimali.happyreader.config.ErrorCode;
import com.heimali.happyreader.core.bean.ManagedRuntimeException;
import com.heimali.happyreader.utils.AndroidUtils;

public class CommonListFragmentHelper {
    
    public static void showFailedError(Object param) {
        if (param instanceof ManagedRuntimeException) {
            if (((ManagedRuntimeException) param).errorCode == ErrorCode.NET_UNAVAILABLE) {
                AndroidUtils.toast(R.string.network_not_available);
            }
        }else {
            AndroidUtils.toast(R.string.loading_failed);
        }
    }
}
